package com.gugee.tiktok.web.dto.web;

import com.gugee.tiktok.web.model.mysql.Ranking;
import com.xiguaji.boot.data.rdb.aggregate.Aggregate;
import com.xiguaji.boot.toolkit.DateTimeUtils;
import com.xiguaji.boot.toolkit.MapperUtils;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Data
public class RankingResponse extends Aggregate {
    private long bloggerType;
    private int ranking;
    private int rankingType;
    private long bloggerId;
    private long uid;
    private String avatar;
    private String nickname;
    private String uniqueId;
    private String state;
    private int position;
    private String score;
    private String follower;
    private String likesGrowth;
    private String reviewGrowth;
    private String shareGrowth;
    private int belong;

    @Mapper(componentModel = "spring", imports = {DateTimeUtils.class, MapperUtils.class})
    public interface RankingResponseMapper {

        @Mapping(source = "likesGrowth", target = "likesGrowth")
        @Mapping(source = "reviewGrowth", target = "reviewGrowth")
        @Mapping(source = "shareGrowth", target = "shareGrowth")
        @Mapping(source = "follower", target = "follower")
        @Mapping(source = "score", target = "score")
        RankingResponse mapper(Ranking ranking);

        List<RankingResponse> mapper(List<Ranking> ranking);


    }


}
